﻿Imports System
Imports System.Collections.Generic
Imports System.ServiceModel
Imports ATS.Business.Components
Imports ATS.Business.Entities
Imports ATS.Services.Contracts

' NOTE:
'
' Service components are responsible for exposing business methods that are
' required to be consumable by external callers as services. This sample uses
' the Business Entities as the data contracts. In larger systems, you may need
' to develop Message Types (Message Contracts) to expose the data.


''' <summary>
''' Service Interface component to expose the expense service to external clients. 
''' </summary>
<ServiceBehavior(UseSynchronizationContext:=False, ConcurrencyMode:=ConcurrencyMode.Multiple, InstanceContextMode:=InstanceContextMode.PerCall)> _
Public Class AssetService
    Implements IAssetService
    Public Sub New()
    End Sub

    'Public Function ListExpensesForEmployee(ByVal employeeID As String) As List(Of Asset)
    '    Try
    '        Dim bc As New AssetComponent()
    '        Return bc.ListExpensesForEmployee(employeeID)
    '    Catch ex As Exception
    '        Throw New FaultException(Of ProcessExecutionFault)(New ProcessExecutionFault(), ex.Message)
    '    End Try
    'End Function

    'Public Function ListExpensesForApproval(ByVal reviewerID As String) As List(Of Asset)
    '    Try
    '        Dim bc As New AssetComponent()
    '        Return bc.ListExpensesForApproval(reviewerID)
    '    Catch ex As Exception
    '        Throw New FaultException(Of ProcessExecutionFault)(New ProcessExecutionFault(), ex.Message)
    '    End Try
    'End Function

    Public Function ListActiveAssets() As MainAssetsTable Implements IAssetService.ListActiveAssets
        Try
            Dim bc As New AssetComponent()
            Return bc.ReadMainAssetDetails("S")
        Catch ex As Exception
            Throw New FaultException(Of ProcessExecutionFault)(New ProcessExecutionFault(), ex.Message)
        End Try
    End Function

    'Public Function ListExpenseReviews(ByVal expenseID As Long) As List(Of ExpenseReview)
    '    Try
    '        Dim bc As New AssetComponent()
    '        Return bc.ListExpenseReviews(expenseID)
    '    Catch ex As Exception
    '        Throw New FaultException(Of ProcessExecutionFault)(New ProcessExecutionFault(), ex.Message)
    '    End Try
    'End Function

    'Public Function ListExpenseLogs(ByVal expenseID As Long) As List(Of ExpenseLog)
    '    Try
    '        Dim bc As New AssetComponent()
    '        Return bc.ListExpenseLogs(expenseID)
    '    Catch ex As Exception
    '        Throw New FaultException(Of ProcessExecutionFault)(New ProcessExecutionFault(), ex.Message)
    '    End Try
    'End Function




End Class

